/*
* INSANE - Interactive Structural Analysis Environment
*
* Copyright (C) 2003-2005
* Universidade Federal de Minas Gerais
* Escola de Engenharia
* Departamento de Engenharia de Estruturas
* 
* Author's email :    insane@dees.ufmg.br
* Author's website :  http://www.dees.ufmg.br/insane
* 
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
* 
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
* 
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
package br.ufmg.dees.insane.ui.rich.learn.util.interfaceGrafica;

import java.awt.Container;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JFrame;

import br.ufmg.dees.insane.ui.rich.learn.learn_view.model_view.command.ModelStiffnessPanel;

/**
*
* @author Moreira, Renata & Pitangueira, Roque
* @since May 2005
*/
public class JanelaTPGUI2 extends JFrame{
	
	private static final long serialVersionUID = 1L;
	private MenuPanel mp;
	private ModelStiffnessPanel mp1;
	
	/** Construtor da JanelaTPGUI 
	 * @param opMetodos lista de metodos a serem exibidos (de qualquer tamanho)
	 */
	public JanelaTPGUI2(String[] opMetodos, int o, Object[][] K, Object[][] f) 
	//public JanelaTPGUI2(String[] opMetodos, int o) 
	{ setTitle("INSANE");
		//	 Pega as configuracoes do usuario
	Toolkit tk=Toolkit.getDefaultToolkit();
	Dimension d = tk.getScreenSize();
	int screenHeight=d.height;
	int screenWidth=d.width;
	int frameWidth=(int)8*screenWidth/10;
	int frameHeight=(int)8*screenHeight/10;
	setSize(frameWidth,frameHeight); 
	addWindowListener(new WindowAdapter()
	    { public void windowClosing(WindowEvent e)
	    { this.windowClosed(e);
	    }
	    } );		
	// posiciona o frame no meio da tela
	setLocation(screenWidth/8,screenHeight/10);
	//Atribui um icone ao frame
	Image icone =tk.getImage("icone.jpg");
	setIconImage(icone);
	//		Cria o container e atribui o layout de GridBag
	Container contentPane=getContentPane();
	mp = new MenuPanel(frameWidth,frameHeight,opMetodos, o, K, f);
	//mp = new MenuPanel(frameWidth,frameHeight,opMetodos, o);
	contentPane.add(mp);
	
	}
	
	public JanelaTPGUI2(int o, Object[][] K) 
	//public JanelaTPGUI2(String[] opMetodos, int o) 
	{ setTitle("INSANE");
		//	 Pega as configuracoes do usuario
	Toolkit tk=Toolkit.getDefaultToolkit();
	Dimension d = tk.getScreenSize();
	int screenHeight=d.height;
	int screenWidth=d.width;
	int frameWidth=(int)8*screenWidth/10;
	int frameHeight=(int)8*screenHeight/10;
	setSize(frameWidth,frameHeight); 
	addWindowListener(new WindowAdapter()
	    { public void windowClosing(WindowEvent e)
	    { this.windowClosed(e);
	    }
	    } );		
	// posiciona o frame no meio da tela
	setLocation(screenWidth/8,screenHeight/10);
	//Atribui um icone ao frame
	Image icone =tk.getImage("icone.jpg");
	setIconImage(icone);
	//		Cria o container e atribui o layout de GridBag
	Container contentPane=getContentPane();
	mp1 = new ModelStiffnessPanel(frameWidth,frameHeight, o, K);
	//mp = new MenuPanel(frameWidth,frameHeight,opMetodos, o);
	contentPane.add(mp1);
	
	}
	
	public MenuPanel getMenuPanel(){
		return mp;
	}

	
}
